package demo;

import com.fenghuaxz.rpcframework.*;
import io.netty.channel.Channel;

import java.net.InetSocketAddress;

public class Example {


    public static void main(String[] args) throws Exception {

        RPCServer server = (RPCServer) new RPCServer().bind(new InetSocketAddress(8000));
        server.addHandler(Console.class.getName(),new ConsoleImpl());

        RPCClient client = (RPCClient) new RPCClient().bind(new InetSocketAddress(8000));
        client.wrapBundle().getBean(Console.class).sayHello();
    }
}
